package com.xbongbong.sso.domain.dao;

import com.xbongbong.sso.domain.entity.OauthUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface OauthUserDao {
    Long insert(OauthUserEntity entity);

    void insertBatch(List<OauthUserEntity> list);

    OauthUserEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    OauthUserEntity getByUserId(@Param("userId") String userId, @Param("corpid") String corpid );

    Integer update(OauthUserEntity entity);

    List<OauthUserEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    OauthUserEntity getByCode(@Param("corpid") String corpid, @Param("code")  String code);
}